package michaelgame.level;

import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import michaelgame.Constants;
import framework.Level;


/**
 * 
 * @author Michael Deng
 * 
 */
public class Level3 extends Level {

    private int mySplashCounter = 0;
    private Image mySplash = null;
    private final int myWidth = 305;
    private final int myHeight = 256;
    private final int myWaitTime = 150;
    private final int myNextLevelIfWin = 4;

    @Override
    protected void initializeLevel () {
        mySplash = super.getMyGame().loadImage("SplashLevelUp.jpg");
    }

    @Override
    protected int testWinCondition () {
        if (mySplashCounter >= myWaitTime) {
            return myNextLevelIfWin;
        }
        return -1;
    }

    @Override
    protected int testLoseCondition () {
        // no lose condition
        return -1;
    }

    @Override
    protected void levelBehavior () {
        mySplashCounter++;
    }

    @Override
    protected void paint (Graphics2D pen) {
        Dimension bounds = Constants.SIZE;
        pen.drawImage(mySplash, bounds.width / 2 - myWidth / 2, bounds.height / 2 - myHeight / 2,
                      myWidth, myHeight, null);

    }

    @Override
    protected void loadLevelObjects () {
        // no objects to load
    }

}
